package com.llb666.shop.items.api.vo;

import com.llb666.shop.items.domain.entity.Items;
import com.llb666.shop.items.domain.entity.ItemsImg;
import com.llb666.shop.items.domain.entity.ItemsParam;
import com.llb666.shop.items.domain.entity.ItemsSpec;
import lombok.Data;

import java.util.List;

/**
 * 商品详情VO
 *
 * @author llb666
 */
@Data
public class ItemsInfoVo {

    /**
     * 商品基础信息.
     */
    private Items item;

    /**
     * 商品图片信息.
     */
    private List<ItemsImg> itemImgList;

    /**
     * 商品规格信息.
     */
    private List<ItemsSpec> itemSpecList;

    /**
     * 商品参数信息.
     */
    private ItemsParam itemParams;


    public static ItemsInfoVo convert(Items items, List<ItemsImg> itemsImgs,
                                      List<ItemsSpec> itemsSpecs, ItemsParam itemsParam) {

        ItemsInfoVo itemsInfoVo = new ItemsInfoVo();
        itemsInfoVo.item = items;
        itemsInfoVo.itemImgList = itemsImgs;
        itemsInfoVo.itemSpecList = itemsSpecs;
        itemsInfoVo.itemParams = itemsParam;
        return itemsInfoVo;
    }
}
